# ==========================================================================
# EARS -- Entity and Association Retrieval System
# Copyright (c) 2009, Krisztian Balog. All rights reserved.
# ==========================================================================

# Makefile
# date:     2009-12-04
# version:  1.0


# Lemur installation
Lemur_dir = PATH_TO_LEMUR

#%.o: %.cpp
#	$(CXX) $(CXXFLAGS) -o $@ -c $<
#%: %.o
#	$(CXX) $(CXXFLAGS) -o $@ $< $(CPPLDFLAGS)
  
# binary 
BIN = ears

# source directory
SRCDIR = src
  
# C++ source files
CPPSRC = $(wildcard $(SRCDIR)/*.cpp)

# object directory
OBJDIR = obj

# objects
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(wildcard $(SRCDIR)/*.cpp))


INCPATH = -I${Lemur_dir}/include -Iinclude 
LIBPATH = ${Lemur_dir}/lib
LIB = lemur
CXX = g++
CXXFLAGS  = -DPACKAGE_NAME=\"EARS\" -DPACKAGE_TARNAME=\"ears\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"EARS\ 0.9\" -DPACKAGE_BUGREPORT=\"krisztian.balog@gmail.com\" -DYYTEXT_POINTER=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBZ=1 -DHAVE_LIBIBERTY=1 -DHAVE_NAMESPACES= -DISNAN_IN_NAMESPACE_STD= -DISNAN_IN_NAMESPACE_GNU_CXX= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -DHAVE_FSEEKO=1 -DHAVE_MKSTEMP=1 -DHAVE_MKSTEMPS=1 -DP_HAS_ATOMIC_INT=1 -DP_NEEDS_GNU_CXX_NAMESPACE=1 -DWITH_DISTRIB=0 -DWITH_SUMMARIZATION=0 -DNDEBUG=1 -DWITH_CLUSTER=0  -g -O2 $(INCPATH)

CPPLDFLAGS  =  -L$(LIBPATH) -l$(LIB) -lz -lpthread -lm 


# object files
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $<

# target file
$(BIN): $(OBJS)
	$(CXX) $(CXXFLAGS) -o $@ $^ $(CPPLDFLAGS)

    
all: $(BIN)
  
clean:
	rm $(BIN) $(OBJDIR)/*.o
